<?php

/**
 * InvoiceAttachmentDr filter form base class.
 *
 * @package    erpcrm
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseInvoiceAttachmentDrFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'dr_number'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'dr_date'         => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'received_by'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'date_received'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'dr_number'       => new sfValidatorPass(array('required' => false)),
      'dr_date'         => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'received_by'     => new sfValidatorPass(array('required' => false)),
      'date_received'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
    ));

    $this->widgetSchema->setNameFormat('invoice_attachment_dr_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'InvoiceAttachmentDr';
  }

  public function getFields()
  {
    return array(
      'invoice_iden'    => 'ForeignKey',
      'attachment_iden' => 'Text',
      'dr_number'       => 'Text',
      'dr_date'         => 'Date',
      'received_by'     => 'Text',
      'date_received'   => 'Date',
    );
  }
}
